package com.tom.aop.config;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author zx
 * @date 2024-08-31 09:09
 */
@Aspect
@Component
public class AopAspect {

    /**
     * 定义一个切点
     */
    @Pointcut("execution( * com.tom.aop.service.*.*(..))")
    public void pointCut() {
    }


    @Before("pointCut()")
    public void doBefore(JoinPoint joinPoint) throws Throwable {
        System.out.println("invoke method before");
    }

}
